//
//  SocketRocketUtility.h
//  SUN
//
//  Created by 孙俊 on 17/2/16.
//  Copyright © 2017年 SUN. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <SRWebSocket.h>
#import "ZXMessageModel.h"
#import "ScoketLotteryModel.h"

@interface SocketRocketUtility : NSObject

// 获取连接状态
@property (nonatomic,assign,readonly) SRReadyState socketReadyState;

@property (nonatomic ,copy) void (^acceptBlock)(ScoketLotteryModel *);
///0成功  1失败  2重练
@property (nonatomic ,copy) void (^connectChange)(NSInteger socketReadyState);


+ (SocketRocketUtility *)instance;

-(void)SRWebSocketOpenWithURLString:(NSString *)urlString;//开启连接
-(void)SRWebSocketClose;//关闭连接
- (void)sendData:(id)data;//发送数据


- (void)senMessage:(ZXMessageModel *)model;
- (NSString *)sendMessageConversion:(NSString *)text;
- (NSString *)getMessageConversion:(NSString *)text;
@end
